Remove the N-th index characterΒΆ
Remove the Nth index character from a nonempty string.
def remove_char(S, n):
first_part = S[:n]
last_pasrt = S[n+1:]
return first_part + last_pasrt
# test
print(remove_char('Python', 0)) # ython
print(remove_char('Python', 3)) # Pyton
print(remove_char('Python', 5)) # Pytho